import paddleocr
# import cv2

ocr = paddleocr.PaddleOCR(use_angle_cls=True, lang='ch')

def ocr_image(image):
    # img = cv2.cvtColor(image, cv2.COLOR_RGB2BGR)
    result = ocr.ocr(image, cls=True)
    result_str = ""
    for result_item in result[0]:
        result_str += result_item[1][0] + "\n"
    return result_str

# gr.Interface(
#     fn=ocr_image,
#     inputs=gr.Image(),
#     outputs=gr.Textbox(),
#     title="PADDLEOCR APP",
#     description="上传图片进行文字识别"
# ).launch(server_name="0.0.0.0", server_port=8080)